//
//  ViewController.m
//  策略模式
//
//  Created by flannery on 2018/12/18.
//  Copyright © 2018年 flannery. All rights reserved.
//

#import "ViewController.h"
#import "Context.h"
#import "Strategy.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    Context *context = [[Context alloc]initWithStrategy:OperationAdd.new];
    NSLog(@"10 + 5 = %d", [context executeStrategyNum1:10 num2:5]);
    
    context = [[Context alloc]initWithStrategy:OperationSubstract.new];
    NSLog(@"10 - 5 = %d", [context executeStrategyNum1:10 num2:5]);
    
    context = [[Context alloc] initWithStrategy:OperationMultiply.new];
    NSLog(@"10 * 5 = %d", [context executeStrategyNum1:10 num2:5]);
}


@end
